<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>${activity.name }</title>
    <link href='${ctxStatic}/css/activity/style.css' rel="stylesheet" type="text/css"/>
    <script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js">
	</script>
	<script>
	function refresh(type){
		$(document).ready(function(){
		    $.post("http://qdingding.c2d.me:8080/qdingding-webapp/a/qd/activity/getActivityDto",
		    {
		      userId:"${activity.userId}",
		      activityId:"${activity.id}"
		    },
		    function(data,status){
		    		 
			  var str="";		
			  var array = data.headImages;			      
		      array.forEach(function(ele,index){
		    	  str = str + "<li class='li-leimg'><img src= "+ele+"/></li>";
		      });

		      var htmStart = "<ul class='ul-image'>"; 
		      var htmEnd = "<li class='li-boripeop'>"+data.collectNumber+"</li></ul>";
		      	
		      if(type == "collect"){
			      $(".ul-image").remove();	      
			      $(".collect-apborder").append(htmStart+str+htmEnd);	
		      }
			  if(type == "enroll"){
			      var enroll="";
			      if(data.enrollState == 'pending'){
			    	  enroll = "<li class='li-ribottom'><strong class = 'progress'>处理中</strong></li>";
			      }
			      if(data.enrollState == 'passed'){
			    	  enroll = "<li class='li-ribottom'><strong class = ''>已通过</strong></li>";
			      }
			      if(data.enrollState == 'nopassed'){
			    	  enroll = "<li class='li-ribottom'><strong class = 'onpass'>未通过</strong></li>";
			      }		      
			      $(".li-ribottom").remove(); 	      		
				  $(".ul-ribirthday").append(enroll);
				  
				  //获取域名
				  host = window.location.host;					  
			  }  		    	  
		      			  			  
		    });

		});		
	}
	
	function userAndroid(){
		window.location.href='${activity.detailUrl }'
		javascript:android.clickHtml();
	}
	</script>
</head>
<body>
<!--    <button onclick= 'refresh("enroll")'style="width:100px;height:50px;">submit</button> 
 --><!--外包裹-->
<div class="warp">
    <!--内容上部分-->
    <div class="top-border">
		<img style="width:100%;height:100%;" alt="" src="${activity.image}">
    </div>
    <!--内容上部分/结束-->
    <!--内容下部分-->
    <div class="buttom-border">
        <!--内容头部生日会-->
        <div class="hrader-border">
            <ul class="ul-birthday">
                <li class="li-left"><h3>${activity.name }</h3></li>
                <li class="li-bodyer"><span class="span-address"></span>&nbsp;${activity.address }</li>
                <li class="li-footer"><span class="span-date"></span>&nbsp;${activity.ondate }</li>
            </ul>
            <ul class="ul-ribirthday">
                <li class="li-right"><strong>${activity.activityType }</strong></li>
                
                 <!-- class="onpass" 未通过选择器 class="progress"正在处理中-->  
                  <c:choose>
                 <c:when test = "${activity.type != 'share' }">
                <c:choose>
                	<c:when test = "${activity.enrollState == 'pending' }">
  						<li class="li-ribottom"><strong class = 'progress'>处理中</strong></li>             	
                	</c:when>  
                	<c:when test = "${activity.enrollState == 'passed' }">
  						<li class="li-ribottom"><strong class = ''>已通过</strong></li>              	
                	</c:when>  
                 	<c:when test = "${activity.enrollState == 'unpassed' }">
  						<li class="li-ribottom"><strong class = 'onpass'>未通过</strong></li>            	
                	</c:when>               	               	         	
                </c:choose>
                </c:when>
                </c:choose>
                
            </ul>
        </div>
        <!--内容头部生日会/结束-->
        <!--活动介绍-->
        <div class="activity-border">
            <div class="particulars-border">
                <p>
					${activity.description }
                </p>
            </div>
            <div class="activity-txborder">
                <a onclick="userAndroid()">活动介绍</a>
            </div>
        </div>
        <!--活动介绍/结束-->
        <!--分割块-->
        <div class="piece-border"></div>
        <!--分割块/结束-->
        <!--收藏-->
        <div class="collect-apborder">
            <div class="title-border">

                <h3>TA们收藏了这个活动</h3>
            </div>
            <ul class="ul-image">
            	<c:forEach  var = "item" items ="${activity.headImages}">
            		<li class="li-leimg"><img src="${item}" alt="收藏" title="收藏" width="100%"/></li>
            	</c:forEach>
                <li class="li-boripeop">${activity.collectNumber }</li>
            </ul>
        </div>
        <!--收藏/结束-->
         <!--分割块-->
        <div class="piece-border"></div>
        <!--分割块/结束-->
     
      <c:choose>
     	<c:when test="${commentList != null}">
        <!--活动评价--> 
        <div class="evaluate-border">
            <h3>活动评价</h3>
            <c:forEach  var = "item" items ="${commentList}">
            <div class="activity-boevaluate">
                <div class="top-evaluate">
                    <!--个人评价-->
                    <ul class="ul-evaluate">
                        <li class="li-avatar"><img src="${item.headImg}" alt="评价头像" title="评价头像"/></li>
                        <li class="li-username">${item.nickname}</li>
        				 <li class="li-date">${item.datetime }</li>
                        <li class="li-praise">
		
						<c:forEach begin="1" end="${item.totalStar}">
  							 <img src="${pageContext.request.contextPath}/assets/images/activity/star.png" alt="评价赞" title="批评赞" width="100%"/>
						</c:forEach>
							                
                        </li>
                    </ul>
                    <div class="div-evaluate">
                        <p>
            				${item.content }
                        </p>
                    </div>
                    <!--个人评价/结束-->
                </div>
                <!--评价图片-->
                <div class="buttom-evaluate">
                    <div class="img-border">
                    <c:forEach var = "image" items = "${item.images}" >
                        <img src="${image.orginPath}" alt="活动图片" title="活动图片" width="100%"/>
					</c:forEach>
                    </div>
                </div>
                <!--评价图片/结束-->
            </div>
            </c:forEach>	           
            </div>
        </div>
        <!--活动评价/结束-->  
       </c:when> 
     </c:choose> 
        <c:choose>
        	<c:when test = "${activity.type == 'share' }">
        	<!---苹果安卓下载链接---->
            <div class="download-warp">
                <ul class="download-border">
                    <li class="li-leandroid" onclick="window.location.href='http://a.app.qq.com/o/simple.jsp?pkgname=com.biostime.qdingding'">
                        <span>
                        </span>
                        <a>安卓下载</a>

                    <li class="li-riphone" onclick="window.location.href='http://a.app.qq.com/o/simple.jsp?pkgname=com.biostime.qdingding'">
                        <span>
                        </span>
                        <a>苹果下载</a>			
                </ul>
            </div>
	  		 <!---苹果安卓下载链接/结束---->               		       		
        	</c:when>
        </c:choose> 

    </div>
    <!--内容下部分/结束-->
</div>
<!--外包裹/结束-->
    <script type="text/javascript" charset="utf-8" src='${pageContext.request.contextPath}/assets/scripts/activity/adaptive.js'></script>
</body>
</html>